package com.hollycrm.ahunicom.sheet.business.hibernate;

import java.util.List;

import org.springframework.orm.hibernate.HibernateTemplate;
import org.springframework.orm.hibernate.support.HibernateDaoSupport;

import com.hollycrm.ahunicom.sheet.business.DepartPermisManager;

public class DepartPermissionManagerImpl extends HibernateDaoSupport implements DepartPermisManager {

	public DepartPermission getDepartPermissionByDeptId(String deptID) {
		HibernateTemplate ht =getHibernateTemplate();
		DepartPermission dp=null;
		String hql="from a in "+DepartPermission.class+" where a.departID='"+deptID+"'";
		List list =ht.find(hql);
		if(list.size()>0){
			dp=(DepartPermission)list.get(0);
		}
		return dp;
	}

}
